import 'package:flutter/material.dart';

class InputTest extends StatelessWidget{
TextEditingController _unameController = TextEditingController();
TextEditingController _psdController = TextEditingController();



  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        TextField(
          autofocus: true,
          controller: _unameController,
          onChanged: (value) {
            print("账号：$value");
          },
          decoration: InputDecoration(
            labelText: "用户名",
            hintText: "用户名或邮箱",
            prefixIcon: Icon(Icons.person)
          ),
        ),
        TextField(
          autofocus: true,
          obscureText: true,
          controller: _psdController,
          onChanged: (value) {
            print("密码：$value");
          },
          decoration: InputDecoration(
            labelText: "密码",
            hintText: "请输入密码",
            prefixIcon: Icon(Icons.lock)
          ),
        ),
        ElevatedButton(onPressed: (){
          print("账号：${_unameController.text}，密码：${_psdController.text}");

        }, child: Text("确认"))
      ],
    );
  
  }

}